import React from 'react'
import i18n from '../../i18n/Index'
import { useTranslation } from 'react-i18next';
import { Button } from 'antd';
function Index() {
   const { t, i18n } = useTranslation();
   const qiehuan=()=>{
    i18n.changeLanguage(i18n.language=='zh'?'en':'zh')
   }
  return (
    <div>
      <h1>{t('name')}</h1>
      <Button onClick={()=>qiehuan()}>{i18n.language='zh'?'中文':"英文"}切换</Button>
      首页
    </div>
  )
}

export default Index